home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / newconf / defaults.mk < prev    next >
Encoding:
Text File  |  1992-08-27  |  1.4 KB  |  51 lines

  1. #------------
  2. #
  3. # default compilation rules
  4. # - conversion rules for the few targets that
  5. #   are common to almost all makefiles
  6. # - needs the variables 
  7. #   CFLAGS, DFLAGS
  8. #   to be correctly set in the main-body makefile {postgres,support}.mk
  9. #
  10. # $Header: /private/postgres/newconf/RCS/defaults.mk,v 1.10 1991/05/14 14:31:23 kemnitz Exp $
  11. #
  12. #
  13. # NOTE:  For portability reasons, the BSD construction 
  14. # "$(*<F)"
  15. # has been replaced by
  16. # `basename $(<F)`
  17. # which is functionally equivalent.
  18. #
  19. #------------
  20.  
  21. .y.o:
  22.     @- echo yaccing $(<F) ; \
  23.     trap 'rm -f yacc.acts yacc.tmp y.tab.c y.output y.tab.h `basename $(<F)`.c `basename $(<F)`.h; exit' 2 ; \
  24.     cd $(@D) ; yacc -dv $(<F) ; \
  25.     if [ -f yacc.sed ] ; then \
  26.         echo "sed'ing y.tab.c" ; \
  27.         sed -f yacc.sed < y.tab.c > `basename $(<F) .y`.c ;\
  28.     else \
  29.          mv y.tab.c `basename $(<F) .y`.c ; \
  30.     fi ; \
  31.     $(CC) $(CFLAGS) $(DFLAGS) -c `basename $(<F) .y`.c ;\
  32.     rm -f `basename $(<F)`.c
  33.     
  34. .c.o:
  35.     @ echo compiling $< | /bin/sed -e 's:$(OD)/::' ; \
  36.     cd $(@D) ; $(CC) $(CFLAGS) $(DFLAGS) -c $(<F)
  37.     
  38. .lex.o:
  39.     @- echo lexing $(<F) ; \
  40.     trap 'rm -f lex.yy.c `basename $(<F)`.c' 2 ; \
  41.     cd $(@D) ; lex $(<F) ; \
  42.     if [ -f lex.sed ] ; then \
  43.         echo "sed'ing lex.yy.c" ; \
  44.         /bin/sed -f lex.sed < lex.yy.c > `basename $(<F) .lex`.c; \
  45.     else \
  46.         mv lex.yy.c `basename $(<F) .lex`.c ; \
  47.     fi ; \
  48.     $(CC) $(CFLAGS) $(DFLAGS) -c `basename $(<F) .lex`.c ; \
  49.     rm -f `basename $(<F) .lex`.c 
  50.     
  51.